<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
	<head>
		<meta charset="utf-8" />
		<title>商品列表</title>
		<script src="<%=request.getContextPath()%>/resources/js/jquery-1.11.3.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/jquery-heima-0.0.1.js" ></script>
		<style type="text/css">
			.a_button_edit{
				background: url(<%=request.getContextPath()%>/resources/img/admin/i_edit.gif) no-repeat;
				display: inline-block;
				width: 18px;
				height: 18px;
			}
			.a_button_del{
				background: url(<%=request.getContextPath()%>/resources/img/admin/i_del.gif) no-repeat;
				display: inline-block;
				width: 18px;
				height: 18px;
			}
			.tr_odd{
				background-color: #CCCCCC;
			}
			.tr_even{
				background-color: #e6e6e6;
			}
			.cate_tr{
				text-align: center;
			}
			.cate_tr:hover{
				background-color: white;
			}
			
		</style>
	</head>
	<body>
		<table cellSpacing="1" cellPadding="0" width="100%" align="center" bgColor="#f5fafe" border="0">
			<tbody>
				<tr>
					<td  align="center" bgColor="#afd1f3">
						<strong>分类列表</strong>
					</td>
				</tr>
				<tr>
					<td  align="right">
							<a href="<%=request.getContextPath()%>/view/admin/category/add.jsp" target="mainFrame">添加</a>
					</td>
				</tr>
				<tr>
					<td>
						<table cellspacing="0"   bordercolor="gray" border="1" style="width:100%;BORDER-COLLAPSE:collapse;" id="nav">
							<tr style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3;text-align: center;">
								<td width="18%">
									序号
								</td>
								<td width="47%">
									分类名称
								</td>
								<td width="7%" >
									操作
								</td>
							</tr>

							<c:forEach items="${nav}" var="a">
							<tr class="cate_tr tr_odd" >
								<td>${a.cid}</td>
								<td>${a.cname}</td>
								<td >
									<a href="<%=request.getContextPath()%>/view/admin/category/edit.jsp?cid=${a.cid}" class="a_button_edit"></a>
									<a href="<%=request.getContextPath()%>/adminServlet?method=delClassify&cid=${a.cid}" class="a_button_del"></a>
								</td>
							</tr>
							</c:forEach>
							<span id="error" hidden>${errors.message}</span>
						</table>
					</td>
				</tr>
			</tbody>
		</table>
		<script>
			var a = document.getElementById("error").innerText;
			if (a.length>1){
				alert(a);
			}
		</script>
	</body>
</html>

